package com.it.asen;

import java.util.Random;
import java.util.Scanner;

public class FindNumber {

    public static void main(String[] args) {


        int[] arr = new int[3];
        arr[0] = 20;
        arr[1] = 10;
        arr[2] = 15;

        int [] arr1 = new int[]{1,2,3};

        System.out.println(arr1[0]);
        System.out.println(arr1[1]);
        System.out.println(arr1[2]);

        System.out.println(arr[0]);
        System.out.println(arr[1]);
        System.out.println(arr[2]);


        /*
        大家一起
        猜数字游戏
         */
        Random random = new Random();
        Scanner scanner = new Scanner(System.in);
        int number  = random.nextInt(100);

        while (true){
            System.out.println("请你输入一个数：");
            int scannernumber= scanner.nextInt();
            if (scannernumber>number){
                System.out.println("你输入的数大了");
            } else if (scannernumber<number){
                System.out.println("你输入的数小了");
            }else {
                System.out.println("恭喜你答对了");
                break;
            }
        }
    }
}
